<template>
	<view>
		<view class="weather-section" v-if="tomorrowWeather">
		      <view class="weather-title">明日天气预报</view>
		      <view class="weather-detail">
		        <text class="weather-item">日期：{{ tomorrowWeather.date }}</text>
		        <text class="weather-item">星期：{{ tomorrowWeather.week }}</text>
		        <text class="weather-item">最高温：{{ tomorrowWeather.high.replace('高温 ', '') }}</text>
		        <text class="weather-item">最低温：{{ tomorrowWeather.low.replace('低温 ', '') }}</text>
		      </view>
			  </view>
	</view>
  <view>
    <view v-for="(item,index) in datalist" style="margin: 10rpx;">
      <CustomTextView
        :nID="item.nID"
        :title="item.title"
        :isTop="item.isTop"
        :author="item.author"
        :comments="item.comments"
        :time="item.time"
        :images="item.images" 
        :mode="item.mode || 1" 
        @click="onCustomViewClick(index)"
      >
        <template v-slot:tips>
          <view class="slotcontent" v-if="item.showSearch">
            <text>搜索：</text>
            <view class="borderbox"><text>今日金价</text></view>
            <view class="borderbox"><text>精选好物</text></view>
          </view>
        </template>
      </CustomTextView>
    </view>
  </view>
</template>

<script>
	import CustomTextView from "../../components/cardViewText.vue";
import newData from "../../Data/news.json";
export default {
  components: {
	  CustomTextView
	  },
  data() {
    return {
      datalist:[]
  //       {
  //         nID: "T15627",
  //         title: "2020,我们温暖的记忆",
  //         isTop: true,
  //         author: "新闻联播",
  //         comments: 105,
  //         time: "2025.10.07",
  //         mode: 1  // 无图模式
  //       },
       
  //       {
  //         nID: "B16684",
  //         title: "把握历史大势共创美好未来",
  //         isTop: false,
  //         author: "人民日报",  // 修正“人们日报”为“人民日报”
  //         comments: 1025,
  //         time: "2025.10.25",
  //         images: ['/static/xidada.png'],  // 字段名改为images
  //         mode: 2  ,// 有图模式

  //       },
  //       {
  //         nID: "B16684",
  //         title: "黄金还能走多远？卖方高呼“第三浪启动,230多份研报看多",
  //         isTop: false,
  //         author: "今日金价",
  //         comments: 1025,
  //         time: "2025.10.11",
  //         images: ['/static/huangjin.png'],  // 字段名改为images
  //         mode: 2  ,// 有图模式
		//   showSearch:true
  //       },
  //       {
  //         nID: "B16633",
  //         title: "没有短板”的完美战鹰！歼-16机库独家探访",
  //         isTop: false,
  //         author: "红星新闻",
  //         comments: 10,
  //         time: "2025.10.24",
  //         images: ['/static/jian.png'],  // 字段名改为images
  //         mode: 2  // 有图模式
  //       },
		// {
		//   nID: "B16633",
		//   title: "加微信交友群，喜欢就聊，敢爱你就来！",
		//   isTop: false,
		//   comments: 10,
		//   time: "2025.10.24",
		//   images: ['/static/xunai.jpeg','/static/ring.jpeg','/static/marry.jpg'],
		//     // 字段名改为images
		//   mode: 3  ,// 有图模式
		  
		// }

    }
  },
  created() {
  	this.datalist = newData.datalist;
	console.log(this.datalist);
  },
  }
  methods: {
   
    }
  

</script>

<style>
.slotcontent {
  margin-top: 5px;
}
.borderbox {
  display: inline-block;
  border: 1px solid #ccc;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 5px;
  color: blue;
  border-color: black;
  font-size: 12px;
}
</style>